package pages;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import resources.Screenshot;

/**
 *
 * @author Einsiedler
 */
public class HomePage {
    private WebDriver driver;
    private Screenshot screenshot = null;
    
    public HomePage(WebDriver driver){
        this.driver = driver;
    }
    /**
     * Method checks a successful login in email and does screen shot
     * Method get username
     * @return 
     */
    public String getusername(){
        String username;
        username = driver.findElement(By.id("gbgs4dn")).getText();
        screenshot = new Screenshot();
        String filescreen = "login.png";
        screenshot.getscreenshot(driver,filescreen);
        return username;
    }
    /**
     * Create new letter
     * @param recipient - отправитель
     * @param theme - тема письма
     */
    public void createletter(String recipient, String theme){
//        driver.findElement(By.className("T-I J-J5-Ji T-I-KE L3")).click();
//        driver.findElement(By.name("to")).sendKeys(recipient);
//        driver.findElement(By.name("subjectbox")).sendKeys(theme);
//        screenshot = new Screenshot();
//        String filescreen = "createletter.png";
//        screenshot.getscreenshot(driver,filescreen);
    }
}
